﻿{extend name="public:base" /}

{block name="content"}

<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-lg-12">
            <div class="ibox ">
                <div class="ibox-content">
                    <form method="post">
                        <div class="box-item">
                            <div class="form-group row">
                                <label class="col-sm-1 col-form-label">标题</label>
                                <div class="col-sm-3">
                                    <input type="text" class="form-control" name="title" placeholder="请输入标题" value="{$info.title}">
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                        </div>

                        <div class="box-item">
                            <div class="form-group row">
                                <label class="col-sm-1 col-form-label">副标题</label>
                                <div class="col-sm-3">
                                    <input type="text" class="form-control" name="vice_title" placeholder="请输入副标题" value="{$info.vice_title}">
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                        </div>

                        <div class="box-item">
                            <div class="form-group row"><label class="col-sm-1 col-form-label">封面图</label>
                                <div class="col-sm-3">
                                    <input type="file" id="img_file" style="display: none">
                                    <input type="hidden" name="img" id="img" value="{$info['img']|default=''}"/>
                                    <img class="upload-file" onclick="uploadImg('img_file', 'img', 'upload_img')" id="upload_img" src="{$info.img ? getPicture($info.img) : '__ADMIN__/img/uploadBtn.png'}">
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                        </div>

                        <div class="box-item">
                            <div class="form-group row">
                                <label class="col-sm-1 col-form-label">分类</label>
                                <div class="col-sm-3">
                                    <select class="form-control m-b" name="type_id">
                                        {volist name="type_list" id="vo"}
                                        <option value="{$vo.id}" {$vo.id== $info.type_id ? 'selected' : ''}>
                                            {$vo.name}
                                        </option>
                                        {/volist}
                                    </select>
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                        </div>

                        <div class="box-item">
                            <div class="form-group row">
                                <label class="col-sm-1 col-form-label">作者</label>
                                <div class="col-sm-3">
                                    <select class="form-control m-b" name="user_id">
                                        {volist name="user_list" id="vo"}
                                        <option value="{$vo.id}" {$vo.id== $info.user_id ? 'selected' : ''}>
                                            {$vo.username}
                                        </option>
                                        {/volist}
                                    </select>
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                        </div>

                        <div class="box-item">
                            <div class="form-group row">
                                <label class="col-sm-1 col-form-label">排序</label>
                                <div class="col-sm-3">
                                    <input type="number" class="form-control" name="sort" placeholder="请输入排序" value="{$info.sort ? $info.sort : 0}">
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                        </div>

                        <div class="box-item">
                            <div class="row">
                                <label class="col-sm-1 col-form-label">内容</label>
                                <div class="col-lg-6">
                                    <div class="ibox ">
                                        <textarea id="editor_id">{$info.content}</textarea>
                                        <textarea name="content" data-editor="kindEditor" style="display: none"></textarea>
                                    </div>
                                </div>
                            </div>

                            <div class="hr-line-dashed"></div>
                        </div>

                        <input type="hidden" name="id" value="{:input('id')}">

                        <div class="form-group row">
                            <div class="col-sm-4 col-sm-offset-2">
                                <button type="button" class="btn btn-w-m btn-default back-page">返回</button>
                                <button type="button" class="btn btn-w-m btn-primary ajax-post">提交</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>

{/block}

{block name='js'}
<script type="text/javascript" src="__PLUG__/kindeditor/kindeditor-all.js"></script>
<script>
    <!-- 实例化编辑器 -->
    initKindEditor('editor_id');
</script>
{/block}
